<?php
	session_start();
	if(!$_SESSION['login'] == 1 && $_SESSION['sessionid'] !== session_id()) {
		header("Location: ./");
		exit;
	}
	
	if($_SESSION['priv'] == 1) {
		$lang = $_SESSION['lang'];
		require_once("include/lang." . $lang . ".php");
		echo ERR_PRIV;
		exit;
	}


	
	if(isset($_GET['mode'])) {
		if($_GET['mode'] == "del") {
			if(!isset($_GET['id'])) {
				die("Missing a id!");
			}
			
			else {
				header("Location: home.php");
				require_once("include/functions.php");
				$id = $_GET['id'];
				$contacts->rm_contact($id);
			}
		}
	}
		
	
	include("include/layout.php");

	html_start();
?>


<br /><br /><br />

<strong>Please select the CSV file to import contacts</strong>
<br />
<br />
<br />
<form action="upload_file.php" method="post"
enctype="multipart/form-data">
<label for="file">Filename:</label>
<input type="file" name="file" id="file" /> 
<br />
<input type="submit" name="submit" value="Submit" />
</form>


<?php
	html_end();
?>